import { h, render } from 'vue'
import MessageComponent from './index.vue'

export const message = (type = 'success', content, duration = 3000) => {
  const destroy = () => {
    render(null, document.body)
  }

  const vNode = h(MessageComponent, { type, content, duration, destroy })
  render(vNode, document.body)
}
